package it.uai.domainsMigrator;
public class ThreadManager {

	private Integer maxThreadNumber;
	private Integer activeThreads = 0;

	public ThreadManager(Integer maxThreadNumber) {
		this.maxThreadNumber = maxThreadNumber;
	}

	public synchronized void enter()
			throws InterruptedException {
		activeThreads++;
	}

	public synchronized void exit() throws InterruptedException {

		activeThreads--;
		notify();
	}

	public Boolean isFull() {

		if (activeThreads <= maxThreadNumber) {
			return false;
		} else {
			return true;
		}

	}

}